<!doctype html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
  <title>自主规划</title>
  <style>
    html,
    body,
    #container {
      width: 100%;
      height: 100%;
    }
    /* 去掉地图logo */

    .BMap_cpyCtrl {
      display: none;
    }

    .anchorBL {
      display: none;
    }

    .amap-logo img {
      display: none;
    }

    .amap-copyright {
      opacity: 0;
    }
  </style>
  <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=53b4e246765e8898dc8ecfa7f7a543e5"></script>
  <script type="text/javascript" src="https://cache.amap.com/lbs/static/addToolbar.js"></script>
</head>

<body>
<div id="container"></div>
<script type="text/javascript">
  var map, route, marker;
  //基本地图加载
  map = new AMap.Map("container", {
    resizeEnable: true
  });
  //绘制初始路径
  var path = [];
  path.push([113.816009, 36.231869]);
  path.push([113.798263, 36.340158]); // 红旗渠淼佳聚园
  path.push([113.768684, 36.354017]); // 红旗渠田园
  path.push([113.755668, 36.363875]);
  map.plugin("AMap.DragRoute", function() {
    route = new AMap.DragRoute(map, path, AMap.DrivingPolicy.LEAST_FEE); //构造拖拽导航类
    route.search(); //查询导航路径并开启拖拽导航
  });
</script>
</body>

</html>